Installing the IO-Warrior driver on Linux 2.6.x

1. Preparations

1.1 Patching module "hid.ko"
To prevent the standard HID input driver from grabbing the IO-Warrior it is necessary to add an entry to the blacklist in the "hid-core.c" file. This file is part of the "hid.ko" module. You can either copy the enclosed module to your system or build a new module with the source files provided.
Typically the path for the folder containing the module on your system is:
	'/lib/modules/<version>/kernel/drivers/usb/input/'
In any case it is advisable to keep a copy of the old module. Though the old module has to be moved away from the drivers folder or it will cause conflict over which module is being loaded.


1.2 Installing the driver
To temporarily run the driver it is sufficient to execute 'insmod iowarrior.ko'. Removing the driver is done with 'rmmod iowarrior' is supported by kernel.
To install the driver permanent copy the file 'iowarrior.ko' in the directory
	'/lib/modules/<version>/kernel/drivers/usb/misc/'
Update the module depencies with the command 'depmod'. These steps will be done by the first part of the shell script "iowarrior_load" if executed with root permission.
You can automatically activate the driver on every system start by an "modprobe iowarrior" entry to the file '/etc/init.d/boot.local'.
The driver is enclosed in source code (iowarrior.c).

1.3 Generating device nodes
Accessing IO-Warrior is done via the "/dev" directory. Appropriate entries have to be generated. The enclosed shell script "iowarrior_load" does automatically generate the necessary entries. The script has to be executed with root permissions. The script will generate device nodes "/dev/usb/iowarrior<X>", X ranges from 0 to 15, this allows you to control up to 8 IO-Warriors (see section 2)



2. Accessing IO-Warrior

Each interface of the IO-Warrior uses one device node. For IOW40 and IOW24 this means they are using two nodes for each chip, the first one for the simple I/O and the second one to access the special mode functions.
The driver has a buffer for 16 data packets per interface. If the 17th packet arrives before any packet has been read the oldest packet will be discarded. To allow detecting a buffer overflow each packet does get a sequence number. Sequence numbers are running from 0 to 255 and wrap, for each packet the sequence number is incremented by 1.
The sequence number is available only for access via the read function, ioctl does not provide the sequence number. The data buffer has to add a byte to the data size to hold the sequence number.

For further details please refer to the sample code.
